<?php
//6级分类
require 'database.php';
$base=new Db;
$____rule_tab1____=$base->doSql('select * from hkcms_auth_rule where parent_id=0 order by id asc');
$data=[];
for ($i = 0; $i < count($____rule_tab1____); $i++) {
    $____rule_tab2____=$base->doSql('select * from hkcms_auth_rule where parent_id="'.$____rule_tab1____[$i]['id'].'" order by id asc');
    $data[]["name"]=$____rule_tab1____[$i]["name"];
    if(count($____rule_tab2____)!=0){
        for ($a = 0; $a < count($____rule_tab2____); $a++) {
            if(!$____rule_tab2____[$a]){
                continue;
            }
            $data[]["name"]='&nbsp;|-'.$____rule_tab2____[$a]["name"];
            $____rule_tab3____=$base->doSql('select * from hkcms_auth_rule where parent_id="'.$____rule_tab2____[$a]['id'].'" order by id asc');
            if(count($____rule_tab3____)!=0){
                for ($b = 0; $b < count($____rule_tab3____); $b++) {
                    if(!$____rule_tab3____[$b]){
                        continue;
                    }
                    if(count($____rule_tab3____)-1==$b){
                        $data[]["name"]='&nbsp;|&nbsp;&nbsp;|_'.$____rule_tab3____[$b]["name"];
                    }else{
                        $data[]["name"]='&nbsp;|&nbsp;&nbsp;|-'.$____rule_tab3____[$b]["name"];
                    }
                    $____rule_tab4____=$base->doSql('select * from hkcms_auth_rule where parent_id="'.$____rule_tab3____[$b]['id'].'" order by id asc');
                    if(count($____rule_tab4____)!=0){
                        for ($c = 0; $c < count($____rule_tab4____); $c++) {
                            if(!$____rule_tab4____[$c]){
                                continue;
                            }
                            if(count($____rule_tab4____)-1==$c){
                                $data[]["name"]='&nbsp;|&nbsp;&nbsp;|&nbsp;&nbsp;|_'.$____rule_tab4____[$c]["name"];
                            }else{
                                $data[]["name"]='&nbsp;|&nbsp;&nbsp;|&nbsp;&nbsp;|-'.$____rule_tab4____[$c]["name"];
                            }
                            $____rule_tab5____=$base->doSql('select * from hkcms_auth_rule where parent_id="'.$____rule_tab4____[$c]['id'].'" order by id asc');
                            if(count($____rule_tab5____)!=0){
                                for ($d = 0; $d < count($____rule_tab5____); $d++) {
                                    if(!$____rule_tab5____[$d]){
                                        continue;
                                    }
                                    if(count($____rule_tab5____)-1==$d){
                                        $data[]["name"]='&nbsp;|&nbsp;&nbsp;|&nbsp;&nbsp;|&nbsp;&nbsp;|_'.$____rule_tab5____[$d]["name"];
                                    }else{
                                        $data[]["name"]='&nbsp;|&nbsp;&nbsp;|&nbsp;&nbsp;|&nbsp;&nbsp;|-'.$____rule_tab5____[$d]["name"];
                                    }
                                    $____rule_tab6____=$base->doSql('select * from hkcms_auth_rule where parent_id="'.$____rule_tab5____[$d]['id'].'" order by id asc');
                                    if(count($____rule_tab6____)!=0){
                                        for ($e = 0; $e < count($____rule_tab6____); $e++) {
                                            if(!$____rule_tab6____[$e]){
                                                continue;
                                            }
                                            if(count($____rule_tab6____)-1==$e){
                                                $data[]["name"]='&nbsp;|&nbsp;&nbsp;|&nbsp;&nbsp;|&nbsp;&nbsp;|&nbsp;&nbsp;|_'.$____rule_tab6____[$e]["name"];
                                            }else{
                                                $data[]["name"]='&nbsp;|&nbsp;&nbsp;|&nbsp;&nbsp;|&nbsp;&nbsp;|&nbsp;&nbsp;|-'.$____rule_tab6____[$e]["name"];
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
// return json($data);
?>
<?php for($i=0;$i<count($data);$i++){?>
<div><?php echo $data[$i]["name"];?></div>
<?php }?>